/*
 * @Copyright: Citylife 2021
 * @Author: shaokui.gu
 * @Date: 2021-02-21 11:40:08
 * @Description: 
 */
import 'network_common.dart';

/// 网络请求代理
abstract class NetworkDelegate {
  /// 发送请求
  void onSendRequest(String key) {}

  /// 业务访问正常回调
  void onBusinessResult(dynamic result, String key, bool isFromCache,
      bool isLastRequest, NetworkAccessType networkAccessType) {}

  /// 发送请求进度
  void onSendProgressChanged(double progress, String key) {}

  /// 接受数据进度
  void onReceiveProgressChanged(double progress, String key) {}

  /// 需要跳过不处理逻辑的回调
  void onSkipHandleResult(String key, bool isLastRequest) {}

  /// 通用异常回调
  void onException(Exception businessException, bool isLastRequest) {}
}
